﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>LINUX command from JAVA</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>
<P><FONT face=Courier><A 
href="http://www.sitepoint.com/forums/showthread.php?533923-Call-Linux-command-from-Java-Application"><FONT face=Courier>http://www.sitepoint.com/forums/showthread.php?533923-Call-Linux-command-from-Java-Application</FONT></A></FONT></P>
<P><FONT face=Courier>public static void main(String[] args) {<BR>&nbsp; try 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp; String command = "cut -f 2,5 ABC/test.tab&gt;ABC/test1.tab";<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
final Process process = 
   Runtime.getRuntime().exec(command);<BR>&nbsp;&nbsp;&nbsp;&nbsp; int returnCode = 
process.waitFor();<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
System.out.println("Return code = " + returnCode);<BR>&nbsp; }catch (Exception e){<BR>&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();<BR>&nbsp; }<BR>}<BR></P></FONT>
<P><FONT face=Courier>return code = 0 la okie </P></FONT></body>
</html>
